<?php


namespace app\Services;

/**
 *
 *
 * User: Implement hdjahs@qq.com
 * Date: 2020/12/8 0:57
 */
class redis
{
public function populateCommandTable() {
//int j;
//
//    // 命令的数量
//int numcommands = sizeof(redisCommandTable)/sizeof(struct redisCommand);
//
//for (j = 0; j < numcommands; j++) {
//
//    // 指定命令
//struct redisCommand *c = redisCommandTable+j;
//
//    // 取出字符串 FLAG
//char *f = c->sflags;
//
//int retval1, retval2;

//
//    // 根据字符串 FLAG 生成实际 FLAG
//while(*f != '\0') {
//switch(*f) {
//case 'w': c->flags |= REDIS_CMD_WRITE; break;
//case 'r': c->flags |= REDIS_CMD_READONLY; break;
//case 'm': c->flags |= REDIS_CMD_DENYOOM; break;
//case 'a': c->flags |= REDIS_CMD_ADMIN; break;
//case 'p': c->flags |= REDIS_CMD_PUBSUB; break;
//case 's': c->flags |= REDIS_CMD_NOSCRIPT; break;
//case 'R': c->flags |= REDIS_CMD_RANDOM; break;
//case 'S': c->flags |= REDIS_CMD_SORT_FOR_SCRIPT; break;
//case 'l': c->flags |= REDIS_CMD_LOADING; break;
//case 't': c->flags |= REDIS_CMD_STALE; break;
//case 'M': c->flags |= REDIS_CMD_SKIP_MONITOR; break;
//case 'k': c->flags |= REDIS_CMD_ASKING; break;
//default: redisPanic("Unsupported command flag"); break;
//}
//f++;
//}
//
//// 将命令关联到命令表
//retval1 = dictAdd(server.commands, sdsnew(c->name), c);
//
//        /* Populate an additional dictionary that will be unaffected
//         * by rename-command statements in redis.conf.
//         *
//         * 将命令也关联到原始命令表
//         *
//         * 原始命令表不会受 redis.conf 中命令改名的影响
//         */
//        retval2 = dictAdd(server.orig_commands, sdsnew(c->name), c);
//
//        redisAssert(retval1 == DICT_OK && retval2 == DICT_OK);
//    }
}
}